#include "rcc.h"

#define GPIOH_MODER (*(volatile unsigned int*)(0x40021C00 + 0x00))
#define GPIOH_ODR 	(*(volatile unsigned int*)(0x40021C00 + 0x14))
	
void beep_init()
{
	RCC_AHB1ENR |= (1 << 7);
	
	GPIOH_MODER |= (1 << 10);
	GPIOH_MODER &= ~(1 << 11);
	
	GPIOH_ODR &= (0 << 5);
	
}

void beep_on()
{
	GPIOH_ODR |= (1 << 5);
}

void beep_off()
{
	GPIOH_ODR &= ~(1 << 5);
}

void delay(unsigned int t)
{
	while(t--);
}

